<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <!-- 用绝对值判断
            if(Math.abs((weight-w))<=10){
                console.log("标准体重")
            }

            if(Math.abs((weight-w))>10){
                console.log("非标准体重")
            }

            // 用绝对值判断
            if(Math.abs((weight-w))<=10){
                console.log("标准体重")
            }

            if(Math.abs((weight-w))>10){
                console.log("非标准体重")
            } -->
            <script>
                var sg=prompt("请输入你的身高");
                var tz=prompt("请输入你的体重");
                var zong=(sg-108)*2-tz;
                if(Math.abs(zong)<=10){
                    console.log("标准体重")
                }else{
                  console.log("非标准体重")
                }
               
            </script>
</body>
</html>